package com.santu.edu.supporter.biz.order.wm.pojo.po;

import com.santu.edu.supporter.biz.order.wm.pojo.dto.WmOrderDTO;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @TableName edu_supporter_order_wai_mai
 */
@Data
@Accessors(chain = true)
public class WmOrderPO implements Serializable {
    /**
     *
     */
    private Long id;

    /**
     * 学校id
     */
    private String schoolId;

    /**
     * 订单号
     */
    private String orderId;

    /**
     * 用户id(发起人)
     */
    private String userId;

    /**
     * 跑路费
     */
    private Long money;

    /**
     * 楼道id
     */
    private String buildingsId;

    /**
     * 购买的商品信息
     */
    private String goodInfo;

    /**
     * 商品图片地址
     */
    private String imageUrl;

    /**
     * 打赏金额
     */
    private Long tipping;

    /**
     * 备注信息
     */
    private String remarkInfo;

    /**
     * 送货地址id
     */
    private String addressId;

    /**
     * 订单状态[0:待认领1:进行中2:已完成]
     */
    private Integer orderType;

    /**
     * 外卖的状态[0:外卖未送到2:外卖已送到,3:已取货]
     */
    private Integer wmType;

    /**
     * 送达照片
     */
    private String sendGoodImage;

    /**
     *
     */
    private String gmtCreate;

    /**
     *
     */
    private String gmtModified;

    private static final long serialVersionUID = 1L;


    public static WmOrderPO createItem(WmOrderDTO dto) {
        return new WmOrderPO()
                .setSchoolId(dto.getSchoolId())
                .setOrderId(dto.getOrderId())
                .setUserId(dto.getUserId())
                .setMoney(dto.getMoney())
                .setBuildingsId(dto.getBuildingsId())
                .setGoodInfo(dto.getGoodInfo())
                .setImageUrl(dto.getImageUrl())
                .setTipping(dto.getTipping())
                .setRemarkInfo(dto.getRemarkInfo())
                .setAddressId(dto.getAddressId())
                .setOrderType(dto.getOrderType().getCode())
                .setWmType(dto.getWmType().getCode())
                .setSendGoodImage(dto.getSendGoodImage());
    }
}